package top.gaui.nurse.jjwt;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

/**
 * @author Fujie_Zeng
 * @version 1.0
 * @date 2020/4/11 10:41
 */
public class ParseJwtTest {
    public static void main(String[] args){
        String token="eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4OCIsInN1YiI6Inl5eSIsImlhdCI6MTU4NjU3Mjc4MX0.Fqd0f2FHhx9FVR5ahEvn_Y0WCiJJWoX7XYiwAFByU2g";
        Claims claims= Jwts.parser().setSigningKey("nurse").parseClaimsJws(token).getBody();
        System.out.println(claims.getId());
        System.out.println(claims.getSubject());
        System.out.println(claims.getIssuedAt());
    }
}
